import turtle
x1, y1, w1, h1 = eval(input("请输入a矩形的x,y坐标跟宽度width,高度height: "))
x2, y2, w2, h2 = eval(input("请输入b矩形的x,y坐标跟宽度width,高度height: "))
xDistance = abs(x1-x2)
yDistance = abs(y1-y2)

turtle.hideturtle()

turtle.penup()
turtle.goto(x1-w1/2,y1-h1/2)
turtle.write("a矩形")
turtle.pendown()

turtle.forward(w1)
turtle.left(90)
turtle.forward(h1)
turtle.left(90)
turtle.forward(w1)
turtle.left(90)
turtle.forward(h1)



turtle.penup()
turtle.home()
turtle.goto(x2-w2/2,y2-h2/2)
turtle.write("b矩形")
turtle.pendown()
turtle.forward(w2)
turtle.left(90)
turtle.forward(h2)
turtle.left(90)
turtle.forward(w2)
turtle.left(90)
turtle.forward(h2)


turtle.penup()
turtle.goto(0,100)
turtle.pendown()

if xDistance <= abs(w1 - w2) / 2 and yDistance <= abs(h1 - h2) / 2 and (w1 - w2)*(h1 - h2)>=0:
    turtle.write("b矩形在a矩形里面" if w1>w2 else "a矩形在b矩形里面")
elif xDistance <= (w1 + w2) / 2 and yDistance <= (h1 + h2) / 2:
    turtle.write("a矩形跟b矩形重叠")
else:
    turtle.write("a矩形跟b矩形不重叠")
turtle.done()